process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = true;
// require("./utils/menu");


const { dialog, app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
const createWindow = () => {
  const win = new BrowserWindow({
    width: 1200,
    height: 800,
	// autoHideMenuBar: false,
    webPreferences: {
	  nodeIntegrationInWorker: true,
      preload: path.join(__dirname, '/preload/index.js')
    }
  });
  
  
  ipcMain.handle("dialog:getUserName",async ()=>{
	let result = dialog.showOpenDialog(win, {
		properties: ['openDirectory'] // 设置为 'openDirectory' 以选择目录
	})
	if(!result.canceled){
		return result.filePaths
	}
	return "当前没有获取到目录";
  });
  
  
  
  
  
  win.loadFile('index.html');
}

app.whenReady().then(() => {
  createWindow();
})